package com.example.demo.model;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @Question Student
 * @Date 2022/11/22 8:52
 * @Solution
 */
@Component
@ConfigurationProperties(prefix = "student") //将配置文件中的Student配置赋值给当前的对象
//这个会调用set方法，如果不写set方法springboot会报错
public class Student {
    private int id;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    private String name;
    private int age;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
}
